<style>
.preview_title{
	float:left;
	margin:0 10px 0 25px;
}
.form_btns{
	margin-top:15px;
}
.disabled{
	margin-right:10px;
}
.colors input, .icons input{
	display:none;
}

.colors div, .icons div{
	border:3px solid #fff;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
.icons div, .preview{
	font-family: "iconfont" !important;
}
.preview{
	border-radius:18px;
	width: 120px;
	height: 120px;
	overflow: hidden;
	font-size: 70px;
	text-align: center;
	line-height: 90px;
	padding: 15px;
	color: #fff;
}
.colors div{
	display:inline-block;
	padding:10px;
	border-radius:0;
	margin:20px 3px;
	position:relative;
	right:-6px;
}
.icons div{
	display:inline-block;
	font-size:25px;
	line-height:34px;
	width:36px;
	height:36px;
	text-align:center;
	background:none;
	color:#666;
	padding:0;
	margin:10px;
	position:relative;
}
.colors input:checked + div, .icons input:checked + div {
	outline: #ccc solid 2px;
}
</style>
<form name="libraryForm" class="dialog_form">
<table>
<tr>
	<th width="110">盒子名称</th>
	<td width="270"><input name="name" type="text" [(ngModel)]="box.name" placeholder="请输入盒子名称"/></td>
	<td width="220" rowspan="3" valign="top" style="padding:0;">
		<div class="preview_title">效果预览</div>
		<div class="preview" [ngStyle]="{background:'#'+box.color}" [html]="box.bg_img"></div>
	</td>
</tr>
<tr>
	<th>盒子背景色</th>
	<td class="colors" style="padding:0;">
		<label *ngFor="let c of colors">
			<input type="radio" name="color" value="{{c}}" [(ngModel)]="box.color" />
			<div [ngStyle]="{background:'#'+c}"></div>
		</label>
	</td>
</tr>
<tr>
	<th valign="top">盒子图标</th>
	<td class="icons" style="width:300px;padding:0;">
		<label *ngFor="let i of icons;">
			<input type="radio" name="icon" value="{{i}}" [(ngModel)]="box.bg_img" />
			<div class="icon" [html]="i"></div>
		</label>
	</td>
</tr>
</table>
<div style="text-align:right;padding:0 10px;" class="form_btns">
	<button (click)="dialog.close();" type="button" class="disabled">取消</button>
	<button (click)="addBox();" [disabled]="!box.color || !box.bg_img || !box.name" type="button">添加</button>
</div>
</form>